 // 告诉gpu以什么精度计算 
 // // 精度范围  highp  -2^16 - 2^16  ;  mediump -2^10 - 2^10  ; lowp -2^8 - 2^8
precision lowp float;

 attribute vec3 position;
 attribute vec2 uv;

// 四维矩阵

uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projectionMatrix;

// 顶点着色器传递数据到 片元着色器

varying vec2 vUv;
varying float vElevation;

// 获取时间
uniform float uTIme;
 
 void main(){
    vUv = uv;
     // 坐标转换
      vec4 modelPosition =  modelMatrix *  vec4( position, 1.0 );
    //   modelPosition.x += 10.0;
    //     modelPosition.z += 10.0;
    // modelPosition.z += modelPosition.x;
//  2.0 控制速度   0.1 控制幅度
    modelPosition.z = sin( (modelPosition.x+uTIme) * 3.0) *0.1;
    modelPosition.z += sin( (modelPosition.y+uTIme) *  3.0) *0.1;
      //  modelPosition.z += sin( modelPosition.y * 0.5 ) * 0.5;
       vElevation = modelPosition.z;
     gl_Position =  projectionMatrix * viewMatrix * modelPosition ;
 }